package com.fengxing.ams.web.task.translator;

import java.util.HashMap;
import java.util.Map;

import com.fengxing.ams.pub.AMSException;

public class SexTranslator implements Translator {

	private static final Map<String, String> cache = new HashMap<String, String> ();
	static {
		cache.put("1", "男");
		cache.put("2", "女");
	}
	private static final String message = "期望值：1|2， 而实际值：";
	@Override
	public String translate(String input) {
		if (!cache.containsKey(input))
			throw new AMSException(message+input);
		return cache.get(input);
	}

}
